﻿using AutoMapper;
using GetSlaughterItem.API.Application.Commands.Week02.DeleteandDisable;
using GetSlaughterItem.API.Application.Commands.Week02.GetScaleData;
using GetSlaughterItem.API.Application.Commands.Week02.ScaleData;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData.AddIPQCGoods;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData.IPQCRemarkData_;
using SlaughterItem.API.Application.Commands.Week02._IPQC.DelOrUpIPQC_;
using SlaughterItem.API.Application.Commands.Week02._IPQC.ShowIPQC_;
using SlaughterItem.API.Application.Commands.Week02._PRQS.AddPRQSData;
using SlaughterItem.API.Application.Commands.Week02._PRQS.DelDisablePRQS;
using SlaughterItem.API.Application.Commands.Week02._PRQS.ShowPRQSData;
using SlaughterItem.API.Application.Commands.Week02.COA;
using SlaughterItem.API.Application.Commands.Week02.Log;

//using SlaughterItem.API.Application.Commands.Week02.Log;
using SlaughterItem.API.Application.Commands.Week02.POOK.AddWhitePork;
using SlaughterItem.API.Application.Commands.Week02.POOK.DelWhitePork;
using SlaughterItem.API.Application.Commands.Week02.POOK.ShowWhitePork;
using SlaughterItem.API.Application.Commands.Week02.RKWeighData_;
using SlaughterItem.API.Application.Commands.Week02.UPC;
using SlaughterItem.Common.Dtos;

namespace SlaughterItem.API.Controllers.TongShiWei
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TSWController : ControllerBase
    {
        public IMediator mediator { get; set; }
        public TSWController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 添加磅秤表数据
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddScaleData(AddScaleDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 修改或删除磅秤表数据
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> DelUpdateScaleData(ScaleDelDisableCommand cmd)
        { 
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 获取磅秤表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> GetScaleData(GetScaleDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加检测项目表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddPRQSData(AddPRQSDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 显示检测项目表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> ShowPRQSData(ShowPRQSDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 删除或禁用检疫项目表 
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> DelDrisableData(DelDisablePRQSCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加检测标准表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddIPQCData(AddIPQCDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加检测标准备注表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddIPQCDataRemarkData(IPQCRemarkDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 显示检测标准表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> ShowIPQCData(ShowIPQCDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 删除+修改(检测标准)
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result>DelOrUpData(DelOrUpCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加白条称重详细表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddWhitePorkData(AddWhitePorkCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 删除白条称重明细表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> DelWhitePorkData(DelWhitePorkCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 显示白条称重明细表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowWhitePorkData()
        {
            return await mediator.Send(new ShowWhitePorkCommand());
        }
        /// <summary>
        /// 显示日志管理表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowLogData()
        {
            return await mediator.Send(new ShowLogDataCommand());
        }
        /// <summary>
        /// 添加日志管理表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddLogData(AddLogDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加分割称重入库
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddRKWeighData(AddRKWeighDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加分割称重入库
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowRKWeighData()
        {
            return await mediator.Send(new ShowRKWeighDataCommand());
        }
        /// <summary>
        /// 删除分割称重入库表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> DelRKWeightData(DelRKWeightDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加检验标准商品表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddIPQCGoodsData(AddIPQCGoodsCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 获取商品分类表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> GetUPCTypeData()
        {
            return await mediator.Send(new GetUPCTypeDataCommand());
        }
        /// <summary>
        /// 添加商品代号数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddUPCData(AddUPCDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 获取商品分类表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> GetUPCData()
        {
            return await mediator.Send(new ShowUPCDataCommand());
        }
        /// <summary>
        /// 获取商品分类表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> GetCPOIpqcData(GetCPOPQCDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 添加检验报告表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> AddCOAIPQCData(AddCOAIPQCDataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
        /// <summary>
        /// 显示检验报告表数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result> ShowCOAData_()
        {
            return await mediator.Send(new ShowCOADataCommand());
        }
        /// <summary>
        /// 删除检验报告表数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> DelCOAData_(DelCOADataCommand cmd)
        {
            return await mediator.Send(cmd);
        }
    }
}
